package com.aorise.utils;

/**
 * @Auther: cat
 * @Date: 2019/5/30
 * @Description: 枚举类数字字典
 */
public interface EnumType {

    /**
     * 设备类型
     */
    enum CA_TYPE {
        CA_TYPE1(1, "海康网络录像机"),
        CA_TYPE2(2, "海康网络摄像机"),
        CA_TYPE3(3, "海康PCDVR"),
        CA_TYPE4(4, "智能设备"),
        CA_TYPE5(5, "海康抓拍机"),
        CA_TYPE6(6, "ONVIF"),
        CA_TYPE7(7, "GB/T28181"),
        CA_TYPE8(8, "海康8464设备"),
        CA_TYPE9(9, "海康可视域相机"),
        CA_TYPE10(10, "大华设备");

        CA_TYPE(Integer id, String value) {
            this.id = id;
            this.value = value;
        }

        public final Integer id;
        public final String value;

        /**
         * 判断值是否存在
         * @param str
         * @return
         */
        public static boolean isHas(String str){
            boolean bol =false;
            for (EnumType.CA_TYPE val : EnumType.CA_TYPE.values()){
                if(val.value.equals(str.trim())){
                    bol =true;
                    break;
                }
            }
            return bol;
        }

        /**
         * 根据ID获取值
         * @param id
         * @return
         */
        public static String getValue(Integer id){
            String iRet = "";
            for (EnumType.CA_TYPE val : EnumType.CA_TYPE.values()){
                if(val.id==id){
                    iRet = val.value;
                    break;
                }
            }
            return iRet;
        }

        /**
         * 根据值获取ID
         * @param value
         * @return
         */
        public static Integer getId(String value){
            Integer id = 0;
            for (EnumType.CA_TYPE val : EnumType.CA_TYPE.values()){
                if(val.value.equals(value.trim())){
                    id = val.id;
                    break;
                }
            }
            return id;
        }
    }

    /**
     * 设备品牌
     */
    enum BRAND {
        BRAND1(1, "海康"),
        BRAND2(2, "大华"),
        BRAND3(3, "宇视"),
        BRAND4(4, "其他");

        BRAND(Integer id, String value) {
            this.id = id;
            this.value = value;
        }

        public final Integer id;
        public final String value;

        /**
         * 判断值是否存在
         * @param str
         * @return
         */
        public static boolean isHas(String str){
            boolean bol =false;
            for (EnumType.BRAND val : EnumType.BRAND.values()){
                if(val.value.equals(str.trim())){
                    bol =true;
                    break;
                }
            }
            return bol;
        }

        /**
         * 根据ID获取值
         * @param id
         * @return
         */
        public static String getValue(Integer id){
            String iRet = "";
            for (EnumType.BRAND val : EnumType.BRAND.values()){
                if(val.id==id){
                    iRet = val.value;
                    break;
                }
            }
            return iRet;
        }

        /**
         * 根据值获取ID
         * @param value
         * @return
         */
        public static Integer getId(String value){
            Integer id = 0;
            for (EnumType.BRAND val : EnumType.BRAND.values()){
                if(val.value.equals(value.trim())){
                    id = val.id;
                    break;
                }
            }
            return id;
        }
    }

    /**
     * 设备安全状态
     */
    enum SAFE {
        SAFE1(1, "安全"),
        SAFE2(2, "不安全");

        SAFE(Integer id, String value) {
            this.id = id;
            this.value = value;
        }

        public final Integer id;
        public final String value;

        /**
         * 判断值是否存在
         * @param str
         * @return
         */
        public static boolean isHas(String str){
            boolean bol =false;
            for (EnumType.SAFE val : EnumType.SAFE.values()){
                if(val.value.equals(str.trim())){
                    bol =true;
                    break;
                }
            }
            return bol;
        }

        /**
         * 根据ID获取值
         * @param id
         * @return
         */
        public static String getValue(Integer id){
            String iRet = "";
            for (EnumType.SAFE val : EnumType.SAFE.values()){
                if(val.id==id){
                    iRet = val.value;
                    break;
                }
            }
            return iRet;
        }

        /**
         * 根据值获取ID
         * @param value
         * @return
         */
        public static Integer getId(String value){
            Integer id = 0;
            for (EnumType.SAFE val : EnumType.SAFE.values()){
                if(val.value.equals(value.trim())){
                    id = val.id;
                    break;
                }
            }
            return id;
        }
    }

    /**
     * 连接状态
     */
    enum ONLINE {
        ONLINE1(1, "在线"),
        ONLINE2(2, "离线");

        ONLINE(Integer id, String value) {
            this.id = id;
            this.value = value;
        }

        public final Integer id;
        public final String value;

        /**
         * 判断值是否存在
         * @param str
         * @return
         */
        public static boolean isHas(String str){
            boolean bol =false;
            for (EnumType.ONLINE val : EnumType.ONLINE.values()){
                if(val.value.equals(str.trim())){
                    bol =true;
                    break;
                }
            }
            return bol;
        }

        /**
         * 根据ID获取值
         * @param id
         * @return
         */
        public static String getValue(Integer id){
            String iRet = "";
            for (EnumType.ONLINE val : EnumType.ONLINE.values()){
                if(val.id==id){
                    iRet = val.value;
                    break;
                }
            }
            return iRet;
        }

        /**
         * 根据值获取ID
         * @param value
         * @return
         */
        public static Integer getId(String value){
            Integer id = 0;
            for (EnumType.ONLINE val : EnumType.ONLINE.values()){
                if(val.value.equals(value.trim())){
                    id = val.id;
                    break;
                }
            }
            return id;
        }
    }

    /**
     * 入网状态
     */
    enum NET_IN {
        NET_IN1(1, "准入"),
        NET_IN2(2, "禁入");

        NET_IN(Integer id, String value) {
            this.id = id;
            this.value = value;
        }

        public final Integer id;
        public final String value;

        /**
         * 判断值是否存在
         * @param str
         * @return
         */
        public static boolean isHas(String str){
            boolean bol =false;
            for (EnumType.NET_IN val : EnumType.NET_IN.values()){
                if(val.value.equals(str.trim())){
                    bol =true;
                    break;
                }
            }
            return bol;
        }

        /**
         * 根据ID获取值
         * @param id
         * @return
         */
        public static String getValue(Integer id){
            String iRet = "";
            for (EnumType.NET_IN val : EnumType.NET_IN.values()){
                if(val.id==id){
                    iRet = val.value;
                    break;
                }
            }
            return iRet;
        }

        /**
         * 根据值获取ID
         * @param value
         * @return
         */
        public static Integer getId(String value){
            Integer id = 0;
            for (EnumType.NET_IN val : EnumType.NET_IN.values()){
                if(val.value.equals(value.trim())){
                    id = val.id;
                    break;
                }
            }
            return id;
        }
    }

    /**
     * 接入网络
     */
    enum NETWORK_TYPE {
        NETWORK_TYPE1(1, "公安信息网"),
        NETWORK_TYPE2(2, "视频专网"),
        NETWORK_TYPE3(3, "交管专网"),
        NETWORK_TYPE4(4, "互联网"),
        NETWORK_TYPE5(5, "税务网"),
        NETWORK_TYPE6(6, "旅业/娱乐场所专网"),
        NETWORK_TYPE7(7, "私有局域网"),
        NETWORK_TYPE8(8, "私有局域网"),
        NETWORK_TYPE9(9, "其他公安业务专网"),
        NETWORK_TYPE10(10, "其他");

        NETWORK_TYPE(Integer id, String value) {
            this.id = id;
            this.value = value;
        }

        public final Integer id;
        public final String value;

        /**
         * 判断值是否存在
         * @param str
         * @return
         */
        public static boolean isHas(String str){
            boolean bol =false;
            for (EnumType.NETWORK_TYPE val : EnumType.NETWORK_TYPE.values()){
                if(val.value.equals(str.trim())){
                    bol =true;
                    break;
                }
            }
            return bol;
        }

        /**
         * 根据ID获取值
         * @param id
         * @return
         */
        public static String getValue(Integer id){
            String iRet = "";
            for (EnumType.NETWORK_TYPE val : EnumType.NETWORK_TYPE.values()){
                if(val.id==id){
                    iRet = val.value;
                    break;
                }
            }
            return iRet;
        }

        /**
         * 根据值获取ID
         * @param value
         * @return
         */
        public static Integer getId(String value){
            Integer id = 0;
            for (EnumType.NETWORK_TYPE val : EnumType.NETWORK_TYPE.values()){
                if(val.value.equals(value.trim())){
                    id = val.id;
                    break;
                }
            }
            return id;
        }
    }

    /**
     * 镜头朝向
     */
    enum ORIENTATION {
        ORIENTATION1(1, "东"),
        ORIENTATION2(2, "南"),
        ORIENTATION3(3, "西"),
        ORIENTATION4(4, "北"),
        ORIENTATION5(5, "东南"),
        ORIENTATION6(6, "东北"),
        ORIENTATION7(7, "西南"),
        ORIENTATION8(8, "西北");

        ORIENTATION(Integer id, String value) {
            this.id = id;
            this.value = value;
        }

        public final Integer id;
        public final String value;

        /**
         * 判断值是否存在
         * @param str
         * @return
         */
        public static boolean isHas(String str){
            boolean bol =false;
            for (EnumType.ORIENTATION val : EnumType.ORIENTATION.values()){
                if(val.value.equals(str.trim())){
                    bol =true;
                    break;
                }
            }
            return bol;
        }

        /**
         * 根据ID获取值
         * @param id
         * @return
         */
        public static String getValue(Integer id){
            String iRet = "";
            for (EnumType.ORIENTATION val : EnumType.ORIENTATION.values()){
                if(val.id==id){
                    iRet = val.value;
                    break;
                }
            }
            return iRet;
        }

        /**
         * 根据值获取ID
         * @param value
         * @return
         */
        public static Integer getId(String value){
            Integer id = 0;
            for (EnumType.ORIENTATION val : EnumType.ORIENTATION.values()){
                if(val.value.equals(value.trim())){
                    id = val.id;
                    break;
                }
            }
            return id;
        }
    }

    /**
     * 监控类型
     */
    enum SECURITY_TYPE {
        SECURITY_TYPE1(1, "一类视频"),
        SECURITY_TYPE2(2, "二类视频"),
        SECURITY_TYPE3(3, "三类视频"),
        SECURITY_TYPE4(4, "公安内部视频监控"),
        SECURITY_TYPE5(5, "其他");

        SECURITY_TYPE(Integer id, String value) {
            this.id = id;
            this.value = value;
        }

        public final Integer id;
        public final String value;

        /**
         * 判断值是否存在
         * @param str
         * @return
         */
        public static boolean isHas(String str){
            boolean bol =false;
            for (EnumType.SECURITY_TYPE val : EnumType.SECURITY_TYPE.values()){
                if(val.value.equals(str.trim())){
                    bol =true;
                    break;
                }
            }
            return bol;
        }

        /**
         * 根据ID获取值
         * @param id
         * @return
         */
        public static String getValue(Integer id){
            String iRet = "";
            for (EnumType.SECURITY_TYPE val : EnumType.SECURITY_TYPE.values()){
                if(val.id==id){
                    iRet = val.value;
                    break;
                }
            }
            return iRet;
        }

        /**
         * 根据值获取ID
         * @param value
         * @return
         */
        public static Integer getId(String value){
            Integer id = 0;
            for (EnumType.SECURITY_TYPE val : EnumType.SECURITY_TYPE.values()){
                if(val.value.equals(value.trim())){
                    id = val.id;
                    break;
                }
            }
            return id;
        }
    }

    /**
     * 室内/室外
     */
    enum INDOOR_OUTDOOR {
        INDOOR_OUTDOOR1(1, "室内"),
        INDOOR_OUTDOOR2(2, "室外");

        INDOOR_OUTDOOR(Integer id, String value) {
            this.id = id;
            this.value = value;
        }

        public final Integer id;
        public final String value;

        public static boolean isHas(String str){
            boolean bol =false;
            for (EnumType.INDOOR_OUTDOOR val : EnumType.INDOOR_OUTDOOR.values()){
                if(val.value.equals(str.trim())){
                    bol =true;
                    break;
                }
            }
            return bol;
        }

        public static String getValue(Integer id){
            String iRet = "";
            for (EnumType.INDOOR_OUTDOOR val : EnumType.INDOOR_OUTDOOR.values()){
                if(val.id==id){
                    iRet = val.value;
                    break;
                }
            }
            return iRet;
        }

        public static Integer getId(String value){
            Integer id = 0;
            for (EnumType.INDOOR_OUTDOOR val : EnumType.INDOOR_OUTDOOR.values()){
                if(val.value.equals(value.trim())){
                    id = val.id;
                    break;
                }
            }
            return id;
        }
    }

    /**
     * 位置类型
     */
    enum LOCATION {
        LOCATION1(1, "省际检查站"),
        LOCATION2(2, "党政机关"),
        LOCATION3(3, "车站码头"),
        LOCATION4(4, "中心广场"),
        LOCATION5(5, "体育场馆"),
        LOCATION6(6, "商业中心"),
        LOCATION7(7, "宗教场所"),
        LOCATION8(8, "校园周边"),
        LOCATION9(9, "治安复杂区域"),
        LOCATION10(10, "交通干线"),
        LOCATION11(11, "旅业场所"),
        LOCATION12(12, "市际公安检查站"),
        LOCATION13(13, "涉外场所"),
        LOCATION14(14, "边境沿线"),
        LOCATION15(15, "旅游景区");

        LOCATION(Integer id, String value) {
            this.id = id;
            this.value = value;
        }

        public final Integer id;
        public final String value;

        /**
         * 判断值是否存在
         * @param str
         * @return
         */
        public static boolean isHas(String str){
            boolean bol =false;
            for (EnumType.LOCATION val : EnumType.LOCATION.values()){
                if(val.value.equals(str.trim())){
                    bol =true;
                    break;
                }
            }
            return bol;
        }

        /**
         * 根据ID获取值
         * @param id
         * @return
         */
        public static String getValue(Integer id){
            String iRet = "";
            for (EnumType.LOCATION val : EnumType.LOCATION.values()){
                if(val.id==id){
                    iRet = val.value;
                    break;
                }
            }
            return iRet;
        }

        /**
         * 根据值获取ID
         * @param value
         * @return
         */
        public static Integer getId(String value){
            Integer id = 0;
            for (EnumType.LOCATION val : EnumType.LOCATION.values()){
                if(val.value.equals(value.trim())){
                    id = val.id;
                    break;
                }
            }
            return id;
        }
    }

    /**
     * 诊断类型
     */
    enum PTYPE {
        PTYPE1(1, "自动巡检"),
        PTYPE2(2, "人工巡检");

        PTYPE(Integer id, String value) {
            this.id = id;
            this.value = value;
        }

        public final Integer id;
        public final String value;

        /**
         * 判断值是否存在
         * @param str
         * @return
         */
        public static boolean isHas(String str){
            boolean bol =false;
            for (EnumType.PTYPE val : EnumType.PTYPE.values()){
                if(val.value.equals(str.trim())){
                    bol =true;
                    break;
                }
            }
            return bol;
        }

        /**
         * 根据ID获取值
         * @param id
         * @return
         */
        public static String getValue(Integer id){
            String iRet = "";
            for (EnumType.PTYPE val : EnumType.PTYPE.values()){
                if(val.id==id){
                    iRet = val.value;
                    break;
                }
            }
            return iRet;
        }

        /**
         * 根据值获取ID
         * @param value
         * @return
         */
        public static Integer getId(String value){
            Integer id = 0;
            for (EnumType.PTYPE val : EnumType.PTYPE.values()){
                if(val.value.equals(value.trim())){
                    id = val.id;
                    break;
                }
            }
            return id;
        }
    }

}
